<script type="text/javascript" src="/extra/fckeditor/fckeditor.js"></script>
<?php
echo $this->adminToolBar('specialtext', 'edit', '/admin/specialtext/add/', '/admin/specialtext/updatespecialtext/', '/admin/specialtext/delete/', '/admin/specialtext/index/');
?>
<table border="1" width="100%" cellpadding="1" cellspacing="2">

    <tr>
		<td width="15%">Parent ID</td>
		<td width="85%">
                    <select name="parentid" id="parentid" class="input-2" >
                         <option value="0">--select--</option>
                        <?php foreach($this->tpl_arr as $arr):?>
                        <option <?php echo ($arr["id"]==$this->specialtext_arr["id"])?"selected":"";?> value="<?php echo $arr["id"]; ?>"><?php echo  $arr["id"]."-". $arr["title"];?></option>
                        <?php endforeach;?>

                    </select>




	</tr>
	
	<tr>
		<td width="15%">specialtext Title(English)</td>
		<td width="85%"><input type="text" name="title" id="title" value="<?php echo $this->specialtext_arr['title']; ?>" class="input-2" /></td>
	</tr>

	<tr>
		<td width="15%">specialtext Title(Russian)</td>
		<td width="85%"><input type="text" name="title_ru" id="title_ru" value="<?php echo $this->specialtext_arr['title_ru']; ?>" class="input-2" /></td>
	</tr>
	<tr>
		<td>specialtext Content (English)</td>
		<td><?php echo $this->EditorFck('description', $this->specialtext_arr['description']); ?></td>
	</tr>
	<tr>
		<td>specialtext Content (Russian)</td>
		<td><?php echo $this->EditorFck('description_ru', $this->specialtext_arr['description_ru']); ?></td>
	</tr>
	<tr>
		<td>Status</td>
		<td>
			<select name="status" id="status" class="input-2">
				<option value="">Select Status</option>
				<option value="1" <?php echo ($this->specialtext_arr['status'] == 1)?"selected='selected'":"" ?>>Published</option>
				<option value="0" <?php echo ($this->specialtext_arr['status'] == 0)?"selected='selected'":"" ?>>Unpublished</option>
			</select>
			<input type="hidden" name="specialtext_id" id="specialtext_id" value="<?php echo $this->specialtext_arr['specialtext_id']; ?>" />
		</td>
	</tr>
</table>
<script type="text/javascript">
function updatespecialtext() 
{
       var parentid=$('#parentid');
       var title=$('#title');
       var title_ru=$('#title_ru');
       var description = FCKeditorAPI.GetInstance("description").EditorWindow.parent.FCK.GetHTML();
       var description_ru = FCKeditorAPI.GetInstance("description_ru").EditorWindow.parent.FCK.GetHTML();
       var status=$('#status');
        if($('#active').attr('checked')==true)
            {
                active=1;

            }
            else{
                active=0;
            }
		$.ajax({
			type: "POST",
			url: '/admin/specialtext/doedit/',
			data: ({title:title.val(),title_ru:title_ru.val(),description:description,description_ru:description_ru,status:status.val(),id:<?php echo $this->Specialtext_id ;?>,parentid:parentid.val()}),
	    	        success: function(data, textStatus, XMLHttpRequest){
	    	   	if(data != '') {
                               alert(data);
                             //  alert("successfully Added the   features");
	    			loadPage('/admin/specialtext/');
	    	   	}
	    	},
	    	complete: function complete(XMLHttpRequest, textStatus){
	         //   $("#loader_area").hide();
	        }
		});

}


function deletestructurefield(id,rateid,hotelid)
{
		$.ajax({
			type: "POST",
			url: '/admin/rates/deletestructuredata/',
			data: ({id:id}),
	    	        success: function(data, textStatus, XMLHttpRequest){
	    	   	if(data != '') {
                               alert(data);
                             //  alert("successfully Added the   features");
	    			loadPage('/admin/rates/ratefeatures/rate_id/'+rateid+'/hotelid/'+hotelid);
	    	   	}
	    	},
	    	complete: function complete(XMLHttpRequest, textStatus){
	            $("#loader_area").hide();
	        }
		});

}

</script>


